#include "sound.h"

using namespace std;

Sound::Sound(string name)
{
	n = name;
}

Sound::Sound(string s, string name)
{
	char txt[256];
	n = name;
	sprintf(txt, "open %s alias %s", s.c_str(), n.c_str());
	mciSendString(txt, NULL, 0, 0);
	//printf("TXT = %s\n", txt);
}

Sound::~Sound()
{

}

void Sound::Open(string s)
{
	char txt[256];
	sprintf(txt, "open %s alias %s", s.c_str(), n.c_str());
	mciSendString(txt, NULL, 0, 0);
	//printf("TXT = %s\n", txt);
}

void Sound::Close()
{
	char txt[256];
	sprintf(txt, "close %s", n.c_str());
	mciSendString(txt, NULL, 0, 0);
	//printf("TXT = %s\n", txt);
}


void Sound::Play()
{
	char txt[256];
	sprintf(txt, "play %s", n.c_str());
	mciSendString(txt, NULL, 0, 0);
	//printf("TXT = %s\n", txt);
}

